package com.ruoyi.common.enums;

public enum  ImportType {
    IMPROTINGDATA("IMPROTINGDATA","正在导入"),
    TOBEIMPROTINGDATA("TOBEIMPROTINGDATA","待导入"),
    RESTRICTIMPORTDATA("RESTRICTIMPORTDATA","限制导入")
    ;
    private String improtTypeCode;
    private String improtTypeMessage;
    public String getImprotTypeCode() {
        return improtTypeCode;
    }

    public void setImprotTypeCode(String improtTypeCode) {
        this.improtTypeCode = improtTypeCode;
    }

    public String getImprotTypeMessage() {
        return improtTypeMessage;
    }

    public void setImprotTypeMessage(String improtTypeMessage) {
        this.improtTypeMessage = improtTypeMessage;
    }

    ImportType(String improtTypeCode, String improtTypeMessage) {
        this.improtTypeCode = improtTypeCode;
        this.improtTypeMessage = improtTypeMessage;
    }

    /**
     * 转为数据
     *
     * @return 枚举对象数组
     */
    public static ImportType getByCode(String improtTypeCode) {

        for (ImportType item : ImportType.values()) {
            if (improtTypeCode.equals(item.getImprotTypeCode())){
                return item;
            }
        }
        return null;
    }
}
